﻿<cms-modal-dialog-container cms-modal-size="large">

    <cms-modal-dialog-header>
        Change Url: <cms-directory-path cms-directory="pageDirectory"></cms-directory-path>
    </cms-modal-dialog-header>

    <cms-form cms-name="updateUrlForm" >

        <cms-page-actions>
            <cms-button-submit cms-text="Save"
                               ng-click="save()"
                               ng-disabled="updateUrlForm.$invalid || submitLoadState.isLoading"
                               cms-loading="submitLoadState.isLoading"></cms-button-submit>

            <cms-button cms-text="Cancel"
                        ng-click="close()"></cms-button>
        </cms-page-actions>

        <cms-page-body>

            <cms-form-status></cms-form-status>

            <cms-warning-message ng-if="hasChildContent">
                WARNING: This directory contains other pages or directories. Changing the url will
                break external links to any pages nested under this directory.
            </cms-warning-message>

            <cms-form-section cms-title="Settings">

                <cms-form-field-text cms-title="Url Path"
                                     cms-model="command.urlPath"
                                     cms-description="The url path segment for this directory. Lowercase alpha-numeric characters and dashes only. E.g. 'about-the-team' or 'products'."
                                     pattern="^[a-zA-Z0-9-]+$"
                                     pattern-val-msg="Alpha-numeric characters and dashes only"
                                     maxlength="200"
                                     required></cms-form-field-text>

                <cms-form-field-dropdown cms-title="Parent Directory"
                                     cms-options="selectableParentDirectories"
                                     cms-option-name="fullUrlPath"
                                     cms-option-value="pageDirectoryId"
                                     cms-model="command.parentPageDirectoryId"
                                     cms-description="The directory to locate this directory under."
                                     ng-if="vm.pageDirectory.depth !== 0"
                                     required></cms-form-field-dropdown>

            </cms-form-section>

        </cms-page-body>

    </cms-form>

</cms-modal-dialog-container>